﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace equinox_proto{

    class BuscarClienteForm : Form
    {
        private TextBox codigoClienteInput;
        private Label codigoClienteLabel;
        private TextBox nombreInput;
        private Label nombreLabel;
        private TextBox nombreContactoInput;
        private Label nombreContactoLabel;
        private TextBox razonSocialInput;
        private Label razonSocialLabel;
        private TextBox rucInput;
        private Label rucLabel;
        private GroupBox grupoInfoEmpresa;
        private GroupBox groupBox1;
        private Button botonBuscar;
        public BuscarClienteForm()
        {
            InitializeComponent();
        }
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BuscarClienteForm));
            this.codigoClienteInput = new System.Windows.Forms.TextBox();
            this.codigoClienteLabel = new System.Windows.Forms.Label();
            this.botonBuscar = new System.Windows.Forms.Button();
            this.nombreInput = new System.Windows.Forms.TextBox();
            this.nombreLabel = new System.Windows.Forms.Label();
            this.nombreContactoInput = new System.Windows.Forms.TextBox();
            this.nombreContactoLabel = new System.Windows.Forms.Label();
            this.razonSocialInput = new System.Windows.Forms.TextBox();
            this.razonSocialLabel = new System.Windows.Forms.Label();
            this.rucInput = new System.Windows.Forms.TextBox();
            this.rucLabel = new System.Windows.Forms.Label();
            this.grupoInfoEmpresa = new System.Windows.Forms.GroupBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.grupoInfoEmpresa.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // codigoClienteInput
            // 
            this.codigoClienteInput.Location = new System.Drawing.Point(245, 60);
            this.codigoClienteInput.Name = "codigoClienteInput";
            this.codigoClienteInput.Size = new System.Drawing.Size(118, 22);
            this.codigoClienteInput.TabIndex = 5;
            // 
            // codigoClienteLabel
            // 
            this.codigoClienteLabel.AutoSize = true;
            this.codigoClienteLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.codigoClienteLabel.Location = new System.Drawing.Point(18, 60);
            this.codigoClienteLabel.Name = "codigoClienteLabel";
            this.codigoClienteLabel.Size = new System.Drawing.Size(78, 23);
            this.codigoClienteLabel.TabIndex = 4;
            this.codigoClienteLabel.Text = "Codigo:";
            // 
            // botonBuscar
            // 
            this.botonBuscar.Font = new System.Drawing.Font("Arial", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.botonBuscar.Location = new System.Drawing.Point(321, 366);
            this.botonBuscar.Name = "botonBuscar";
            this.botonBuscar.Size = new System.Drawing.Size(199, 78);
            this.botonBuscar.TabIndex = 14;
            this.botonBuscar.Text = "Buscar";
            this.botonBuscar.UseVisualStyleBackColor = true;
            this.botonBuscar.Click += new System.EventHandler(this.botonBuscar_Click);
            // 
            // nombreInput
            // 
            this.nombreInput.Location = new System.Drawing.Point(245, 120);
            this.nombreInput.Name = "nombreInput";
            this.nombreInput.Size = new System.Drawing.Size(118, 22);
            this.nombreInput.TabIndex = 16;
            // 
            // nombreLabel
            // 
            this.nombreLabel.AutoSize = true;
            this.nombreLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.nombreLabel.Location = new System.Drawing.Point(18, 120);
            this.nombreLabel.Name = "nombreLabel";
            this.nombreLabel.Size = new System.Drawing.Size(168, 23);
            this.nombreLabel.TabIndex = 15;
            this.nombreLabel.Text = "Nombre empresa:";
            // 
            // nombreContactoInput
            // 
            this.nombreContactoInput.Location = new System.Drawing.Point(232, 60);
            this.nombreContactoInput.Name = "nombreContactoInput";
            this.nombreContactoInput.Size = new System.Drawing.Size(118, 22);
            this.nombreContactoInput.TabIndex = 18;
            // 
            // nombreContactoLabel
            // 
            this.nombreContactoLabel.AutoSize = true;
            this.nombreContactoLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.nombreContactoLabel.Location = new System.Drawing.Point(6, 60);
            this.nombreContactoLabel.Name = "nombreContactoLabel";
            this.nombreContactoLabel.Size = new System.Drawing.Size(198, 23);
            this.nombreContactoLabel.TabIndex = 17;
            this.nombreContactoLabel.Text = "Nombre del contacto:";
            // 
            // razonSocialInput
            // 
            this.razonSocialInput.Location = new System.Drawing.Point(245, 180);
            this.razonSocialInput.Name = "razonSocialInput";
            this.razonSocialInput.Size = new System.Drawing.Size(118, 22);
            this.razonSocialInput.TabIndex = 28;
            // 
            // razonSocialLabel
            // 
            this.razonSocialLabel.AutoSize = true;
            this.razonSocialLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.razonSocialLabel.Location = new System.Drawing.Point(19, 180);
            this.razonSocialLabel.Name = "razonSocialLabel";
            this.razonSocialLabel.Size = new System.Drawing.Size(127, 23);
            this.razonSocialLabel.TabIndex = 27;
            this.razonSocialLabel.Text = "Razon social:";
            // 
            // rucInput
            // 
            this.rucInput.Location = new System.Drawing.Point(245, 240);
            this.rucInput.Name = "rucInput";
            this.rucInput.Size = new System.Drawing.Size(118, 22);
            this.rucInput.TabIndex = 30;
            // 
            // rucLabel
            // 
            this.rucLabel.AutoSize = true;
            this.rucLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.rucLabel.Location = new System.Drawing.Point(19, 240);
            this.rucLabel.Name = "rucLabel";
            this.rucLabel.Size = new System.Drawing.Size(57, 23);
            this.rucLabel.TabIndex = 29;
            this.rucLabel.Text = "RUC:";
            // 
            // grupoInfoEmpresa
            // 
            this.grupoInfoEmpresa.Controls.Add(this.codigoClienteLabel);
            this.grupoInfoEmpresa.Controls.Add(this.codigoClienteInput);
            this.grupoInfoEmpresa.Controls.Add(this.nombreInput);
            this.grupoInfoEmpresa.Controls.Add(this.rucInput);
            this.grupoInfoEmpresa.Controls.Add(this.rucLabel);
            this.grupoInfoEmpresa.Controls.Add(this.nombreLabel);
            this.grupoInfoEmpresa.Controls.Add(this.razonSocialInput);
            this.grupoInfoEmpresa.Controls.Add(this.razonSocialLabel);
            this.grupoInfoEmpresa.Location = new System.Drawing.Point(12, 33);
            this.grupoInfoEmpresa.Name = "grupoInfoEmpresa";
            this.grupoInfoEmpresa.Size = new System.Drawing.Size(395, 299);
            this.grupoInfoEmpresa.TabIndex = 33;
            this.grupoInfoEmpresa.TabStop = false;
            this.grupoInfoEmpresa.Text = "Informacion corporativa";
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.nombreContactoLabel);
            this.groupBox1.Controls.Add(this.nombreContactoInput);
            this.groupBox1.Location = new System.Drawing.Point(431, 33);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(391, 299);
            this.groupBox1.TabIndex = 34;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Informacion de contacto";
            // 
            // BuscarClienteForm
            // 
            this.ClientSize = new System.Drawing.Size(849, 475);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.grupoInfoEmpresa);
            this.Controls.Add(this.botonBuscar);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "BuscarClienteForm";
            this.Text = "Buscar cliente";
            this.grupoInfoEmpresa.ResumeLayout(false);
            this.grupoInfoEmpresa.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);

        }
        private void botonBuscar_Click(object sender, EventArgs e)
        {
            if (validarDatos())
            {
                ClienteModel clienteBusquedaData = new ClienteModel();
                clienteBusquedaData.CodigoCliente = this.codigoClienteInput.Text;
                clienteBusquedaData.NombreContacto = this.nombreContactoInput.Text;
                clienteBusquedaData.NombreReferencia = this.nombreInput.Text;
                clienteBusquedaData.RazonSocial = this.razonSocialInput.Text;
                clienteBusquedaData.Ruc = this.rucInput.Text;
                List<ClienteModel> clientes = ClienteModel.buscarCliente(clienteBusquedaData);
                BusquedaClienteForm busquedaClienteForm = new BusquedaClienteForm(clientes);
                busquedaClienteForm.ShowDialog();
            }
        }
        private bool validarDatos()
        {
            return true;
        }
    }
}
